package com.pachong.android.baseuicomponent.activity;


import android.view.LayoutInflater;

import com.pachong.android.baseuicomponent.CompState;
import com.pachong.android.baseuicomponent.ILoadable;
import com.pachong.android.baseuicomponent.LoadState;
import com.pachong.android.baseuicomponent.NetUtils;
import com.pachong.android.baseuicomponent.view.BottomLoadStateView;


/**
 * 带有加载状态UI切换的Activity
 */
public abstract class LoadableActivity extends BaseActivity implements ILoadable {

    @Override
    public void startLoading() {
        if (NetUtils.getNetworkStatus(this) == NetUtils.NETWORK_STATE_IDLE) {
            setState(CompState.EMPTY_INVALID_NEWWORK);
            return;
        }

        setState(CompState.EMPTY_REFRESHING);
        onStartLoading();

    }


    @Override
    public void setAutoLoading(boolean auto) {

    }

    @Override
    public void setTriggerLoadItemCount(int itemCount) {

    }

    @Override
    public BottomLoadStateView createBottomLoadStateView(LayoutInflater inflater) {
        return null;
    }


    @Override
    public void changeLoadState(LoadState loadState) {

    }
}
